<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>定位</title>

		<style>
			.absolute {
				position: absolute;
				top: 100px;
				left: 100px;
			}
			
/*			div {
				background-color: red;
				width: 200px;
				height: 200px;
			}*/
			
			#relatation {
				background-color: greenyellow;
				margin-top: 300px;
				width: 200px;
				height: 200px;
				clear: both;
				
			}
			
			.inside{
				width: 100px;
				height: 100px;
				background-color: red;
				position: relative;
				top: 50px;
			}
	
		</style>
	<link rel="stylesheet" href="css/positoin.css" />
	</head>

	<body>
		<!--定位分为3中-->
		<!--1：绝对定位-->
<!--		<div class="">

		</div>
		<div class="absolute">

		</div>
		<div style="clear: both;color: #FFFF00; height: 2px;width: 100%;">

		</div>-->
		<!--2：相对定位-->

		<div id="relatation">
			<div class="inside">
		
			</div>
		</div>
				<div id="relatation">
			<div class="inside">
		
			</div>
		</div>
				<div id="relatation">
			<div class="inside">
		
			</div>
		</div>
				<div id="relatation">
			<div class="inside">
		
			</div>
		</div>
		<!--3：fix定位-->
		<div class="fix">
			fix
		</div>
	</body>

</html>